Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to improve treekill #3554

Closed
wants to merge 1 commit into from
Closed

Conversation

soyuka
Copy link
Collaborator

@soyuka soyuka commented Mar 19, 2018

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets na
License MIT

Don't merge this for now.

Attempt to improve treekill performances (the pstree module could be used to get a child process monitoring on pm2 see this 2 years wanted feature #1869).
@simonepri has worked on the best way to get a tree of a given PID. He has found out that ps was faster then pgrep. Let's see how the test suite runs for now.

@simonepri
Copy link

simonepri commented Mar 20, 2018

The current implementation recursively remove all the children by calling pgrep or ps multiple times utill there aren't any more children to visit.

Indeed, pgrep -P and ps -o pid --ppid just looks for the direct children of the given pid and does not return the whole subtree do you need to call them more than once.
image

This has the great advantage of removing the need of parsing the whole pid list as I do in pidtree.
I don't know if this actually improve performance.
I believe that the overhead of spawning ps or pgrep or ps a lot of time should kill any kind of advantage.

@CLAassistant
Copy link

CLAassistant commented Oct 24, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


abluchet seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Unitech Unitech deleted the branch Unitech:development February 17, 2022 09:13
@Unitech Unitech closed this Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants